package cn.school.student.common.enumdir;

import lombok.Getter;

@Getter
public enum NationEnum {

    han("汉",0),
    hanzu("汉族",0),
    miao("苗族",1),
    tu("土家族",2),
    dong("侗族",3),
    yao("瑶族",4),
    hui("回族",5),
    zhuang("壮族",6),
    bai("白族",7),
    wei("维吾尔族",8),
    man("满族",9),
    meng("蒙古族",10),
    she("畲族",11);

    NationEnum(String label,Integer value){
        this.label=label;
        this.value=value;
    }

    private String label;

    private Integer value;

    //通过label获取对应的枚举实例
    public static NationEnum getByLabel(String name) {
        NationEnum [] list = values();
        for (NationEnum nationEnum : list) {
            if ((nationEnum.label).equals(name)) {
                return nationEnum;
            }
        }
        return null;
    }
}
